package mt.server;
import mt.Order;
import mt.comm.*;
import java.util.ArrayList;


public class Server implements ServerComm{


private ArrayList<String> clienteligado = new ArrayList<String>();
private ArrayList<String> clienteparadesligar = new ArrayList<String>();
private ArrayList<String> amigo = new ArrayList<String>();

// STANDARD ERROR MESSAGES
public static final String ERROR_CLIENT_OFFLINE = "ERROR - Client offline";
public static final String ERROR_FRIEND_D_OFFLINE = "ERROR - Friend(d) offline";
public static final String ERROR_PAYLOAD_NULL = "ERROR - Payload is null";
public static final String ERROR_SERVERCOMM_NULL = "ERROR - serverComm is null";

public static final String ERROR_MESSAGE_NULL = "ERROR - serverComm.getNextMessage() returns null";
public static final String ERROR_DUPLICATED_NICKNAME = "";

private ArrayList<String> errorLog = new ArrayList<String>();
private int numberOfErrors = 0;

private ServerComm server ;
	@Override
	public void start() {
		

		
		 // &&this.server = serverComm();
          while(true)
          {
                  server.start();
                  getNextMessage();
          }
          
	}

	@Override
	public ServerSideMessage getNextMessage() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean hasNextMessage() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void sendOrder(String receiversNickname, Order order) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void sendError(String toNickname, String error) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean clientIsConnected(String nickname) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void disconnectClient(String nickname) {
		// TODO Auto-generated method stub
		
	}
	
	
}
